import request from '@/utils/request'

const baseURL = '/admin/comment'

// 获取评论列表
export const getCommentList = (params) => {
  return request.post(`${baseURL}/list`, {
    rating: params.rating,
    isAnonymous: params.isAnonymous,
    pageNum: params.pageNum || 1,
    pageSize: params.pageSize || 10
  })
}

// 修改评论
export const updateComment = (data) => {
  return request.post(`${baseURL}/update`, {
    orderId: data.orderId,
    content: data.content?.trim(),
    rating: data.rating,
    images: Array.isArray(data.images) ? data.images.join(',') : data.images,
    isAnonymous: data.isAnonymous
  })
} 